import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 强仔
 * Date: 2022-07-02
 * Time: 14:55
 */
public class Main {

    // 统计回文
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String A = scanner.next();
        String B = scanner.next();
        int count = 0;


        int lenA = A.length();
        int lenB = B.length();

        StringBuffer strA = new StringBuffer(A);
        for (int i = 0; i <= lenA; i++) {
            strA.insert(i,B);
            if(isCycle(strA)){
                count++;
            }
            strA.delete(i, i+lenB);
        }
        System.out.println(count);

        System.out.println(CycleCount(A,B));
    }

    public static boolean isCycle(StringBuffer newStr){
        char[] chars = newStr.toString().toCharArray();
        int left = 0;
        int right = newStr.length() - 1;
        while(left < right){
            if(chars[left] != chars[right]){
                return false;
            }
            left++;
            right--;
        }
        return true;
    }

    // 统计回文
    public static int CycleCount(String A, String B){
        int count = 0;
        for (int i = 0; i <= A.length(); i++) {
            StringBuffer str = new StringBuffer(A);
            str.insert(i, B);

            StringBuffer s = new StringBuffer(str);
            if(s.toString().equals(str.reverse().toString())){
                count++;
            }
        }
        return count;
    }

    // 最大子数组的和
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        }

        long[] F = new long[n];
        F[0] = array[0];

        for (int i = 1; i < n; i++) {
            F[i] = F[i - 1] < 0 ? array[i] : F[i - 1] + array[i];
        }

        long max = Long.MIN_VALUE;
        for (long value : F) {
            max = Math.max(value, max);
        }

        System.out.println(max);
    }
}
